var newsTable;
function getqqRecordList() {
	getlist();
    if (typeof newsTable !== 'undefined') {
        newsTable.fnPageChange('first');
        return;
    }
    var i = 1;
    newsTable = $("#qqRecordList").DataTable({
        "sAjaxSource": _path + "/qqRecord/queryByPage",          
        "fnServerParams": function (aoData) {
            aoData.push(
                {"name": "qq_account" ,"value":$("#qq_account").val()},
                {"name": "user_ip" ,"value":$("#user_ip").val()},
                {"name": "state" ,"value":$("#state").val()},
                { "name": "fromDate", "value": $("#fromDate").val() },
                { "name": "toDate", "value": $("#toDate").val() }
            );
        },
        "sServerMethod": "POST",
        "sAjaxDataProp": "dataList",
        "fnCreatedRow": function () {
            i++;
        },
        "fnPreDrawCallback": function () {
            i = 1;
        },
        "aoColumns": [
            { "sTitle": "序号", "sWidth": "2%",
                "mData": function () {
                    return i;
                }
            },    
            { "sTitle": "id", "mData": "id", "sWidth": "10%" },
            { "sTitle": "ip", "mData": "user_ip", "sWidth": "10%" },
            { "sTitle": "qq号码", "mData": "qq_account", "sWidth": "10%" },
            { "sTitle": "mac地址", "mData": "mac", "sWidth": "10%" ,
            	"mRender": function (data) {
            		var mac = '';
                    switch (data) {
                        case 'null':
                        	mac = '';
                            break;
                        case '':
                        	mac = '';
                            break;
                        default :
                        	mac = '未知';
                            break;
                    }
                    return mac;
            		}
                },
            { "sTitle": "状态", "mData": "state", "sWidth": "10%",
            	"mRender": function (data) {
                    var state = '';
                    switch (data) {
                        case 1:
                        	state = '上线';
                            break;
                        case 2:
                        	state = '离线';
                            break;
                        default :
                        	state = '未知';
                            break;
                    }
                    return state;
                }
            },
            { "sTitle": "记录时间", "mData": "createTime", "sWidth": "10%" },
        ]
    });
    

}


